package com.itheima.web;

import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import org.apache.poi.ss.usermodel.Workbook;

import java.io.FileOutputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;

public class ExportDataTest {

    public static void main(String[] args) throws Exception {
        TemplateExportParams params = new TemplateExportParams("report_template.xlsx");
        Map data = new HashMap<>();
        data.put("curdate","2020-10-27");
        data.put("curdatemember",10);
        Workbook workbook = ExcelExportUtil.exportExcel(params, data);
        OutputStream os = new FileOutputStream("c:/work/exportData.xlsx");
        workbook.write(os);
        os.flush();
        os.close();
    }

}
